#FROM openjdk:8-jdk-alpine
FROM ubuntu/nginx:1.18-21.04_edge
USER root
MAINTAINER Gonsin
ENV TZ=Asia/Shanghai
ENV LANG C.UTF-8



#RUN mv /etc/apt/sources.list /etc/apt/sources.list.bk
#COPY sources.list /etc/apt/sources.list
#RUN apt-get update
#RUN DEBIAN_FRONTEND=noninteractive apt install -y tzdata
#RUN apt-get install -y wget

# 安装java
# RUN #wget http://update.gonsincloud.com/jenkins/jdk-8u231-linux-x64.tar.gz

ADD http://update.gonsincloud.com/jenkins/jdk-8u231-linux-x64.tar.gz .
RUN tar zxvf jdk-8u231-linux-x64.tar.gz -C /usr/local/
ENV JAVA_HOME /usr/local/jdk1.8.0_231
ENV PATH $PATH:$JAVA_HOME/bin
RUN java -version


#同步时间
# RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
#    apk update && apk add wget unzip vim && apk add -U tzdata && \
#    ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
RUN mkdir -p /root/neutrino-proxy/config
RUN mkdir -p /root/neutrino-proxy/nginx
RUN mkdir -p /root/neutrino-proxy/cert
RUN mkdir -p /root/neutrino-proxy/neutrino-proxy-admin
WORKDIR /root/neutrino-proxy
COPY neutrino-proxy-server/target/neutrino-proxy-server.jar /root/neutrino-proxy/neutrino-proxy-server.jar
COPY neutrino-proxy-server/src/main/resources/app.yml /root/neutrino-proxy/config
COPY neutrino-proxy-admin/dist /root/neutrino-proxy/neutrino-proxy-admin/dist
COPY nginxTemplate/nginx.conf /root/neutrino-proxy/nginxTemplate/nginx.conf

# 安装nginx
COPY nginx.conf /etc/nginx/nginx.conf
RUN nginx

#VOLUME ["/root/neutrino-proxy"]
ENTRYPOINT ["java","-jar","neutrino-proxy-server.jar","config=./config/app.yml"]

#docker run -it -p 9000-9200:9000-9200/tcp -p 8888:8888 -v /root/neutrino-proxy/config:/root/neutrino-proxy/config -d --restart=always --name neutrino registry.cn-hangzhou.aliyuncs.com/asgc/aoshiguchen-docker-images:1.7